home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 3 / CD ACTUAL 3.iso / linux / sonido / mod-0.000 / mod-0 / mod / debug.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-05  |  805 b   |  59 lines

  1. /*
  2.  *  debug.c - Global functions for printing debug/error/warning/info-messages.
  3.  *
  4.  *  (C) 1994 Mikael Nordqvist (d91mn@efd.lth.se, mech@df.lth.se)
  5.  */
  6.  
  7. #include <stdio.h>
  8. #include <stdarg.h>
  9.  
  10. #include "mod.h"
  11.  
  12. extern struct options opt;
  13.  
  14. void debug(char *s, ...)
  15. {
  16.     va_list args;
  17.  
  18.     if(1) {
  19.     va_start(args, s);
  20.     vprintf(s, args);
  21.     fflush(stdout);
  22.     va_end(args);
  23.     }
  24. }
  25.  
  26. void error(char *s, ...)
  27. {
  28.     va_list args;
  29.  
  30.     va_start(args, s);
  31.     vprintf(s, args);
  32.     fflush(stdout);
  33.     va_end(args);
  34.  
  35.     exit(1);
  36. }
  37.  
  38. void warning(char *s, ...)
  39. {
  40.     va_list args;
  41.  
  42.     va_start(args, s);
  43.     vprintf(s, args);
  44.     fflush(stdout);
  45.     va_end(args);
  46. }
  47.  
  48. void info(char *s, ...)
  49. {
  50.     va_list args;
  51.  
  52.     if(opt.verbose) {
  53.     va_start(args, s);
  54.     vprintf(s, args);
  55.     fflush(stdout);
  56.     va_end(args);
  57.     }
  58. }
  59.